import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  css: {
    preprocessorOptions: {
      less: {
        modifyVars:{
          'primary-color': '#1890ff',
        }
      },
    },
  },
  server: {
    proxy: {
      "/api": {
        target: "https://aip.baidubce.com/", // 目标服务器地址
        changeOrigin: true, // 是否改变源地址
        secure: false, // 是否支持https
        rewrite: (path: string) => path.replace(/^\/api/, ""), // 重写路径
      },
    },
  },
});
